/**
 * useMemo记忆组件
 */
 import React, { useState, useMemo } from 'react';
 
 export default function Memos() {
   const [count, setCount] = useState(1);
 
   const memo = useMemo(() => {
     console.log("count更新了"+count);
     return count
   }, [count]); //count更新时执行
 
 
   return <div>
     <h4>{count}</h4>
     <div>
       <button onClick={() => setCount(count + 1)}>+</button>
     </div>
   </div>;
 }